<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('mesure/'.($form->getObject()->isNew() ? 'create?id_echantillon='.$echantillon->getIdEchantillon() : 'update').(!$form->getObject()->isNew() ? '?id_mesure='.$form->getObject()->getIdMesure() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table class="formulaire">
      <thead>
          <tr><th colspan="3">Fiche mesure</th></tr>
      </thead>
    <tfoot>
      <tr>
        <td colspan="3">
          <?php echo $form->renderHiddenFields(false) ?>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php //echo link_to('Delete', 'mesure/delete?id_mesure='.$form->getObject()->getIdMesure(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
          <?php endif; ?>
          <input type="submit" value="Enregistrer" class="submit" />
          <?php if ($form->getObject()->isNew()): ?>
          <a href="<?php echo url_for('echantillon/show?id_echantillon='.$echantillon->getIdEchantillon()) ?>" class="submit">Annuler</a>
          <?php else : ?>
          <a href="<?php echo url_for('mesure/show?id_mesure='.$mesure->getIdMesure()) ?>" class="submit">Annuler</a>
          <?php endif; ?>
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
        <tr>
            <th>Méthode de mesure</th>
            <td><?php echo $form['id_methode_mesure'] ?></td>
            <td><?php echo $form['id_methode_mesure']->renderError() ?></td>
        </tr>
        <tr>
            <th>Lieu</th>
            <td><?php echo $form['id_lieu'] ?></td>
            <td><?php echo $form['id_lieu']->renderError() ?></td>
        </tr>
        <tr>
            <th>Succès</th>
            <td><?php echo $form['ok'] ?></td>
            <td><?php echo $form['ok']->renderError() ?></td>
        </tr>
        <tr>
            <th>Date de la mesure</th>
            <td>
                <input id="label_choix_date" disabled="disabled" value="<?php if ($form->getObject()->getDateMesure()) echo $form->getObject()->getDateTimeObject('date_mesure')->format('D, d M, Y'); ?>"></input>
                <?php echo $form['date_mesure'] ?>
            </td>
            <td><?php echo $form['date_mesure']->renderError() ?></td>
        </tr>
        <tr>
            <th>Fichier ou dossier (Données non traitées)</th>
            <td><?php echo $form['fichiernt'] ?></td>
            <td><?php echo $form['fichiernt']->renderError() ?></td>
        </tr>
        <tr>
            <th>Fichier ou dossier (Données traitées)</th>
            <td><?php echo $form['fichiert'] ?></td>
            <td><?php echo $form['fichiert']->renderError() ?></td>
        </tr>
    </tbody>
  </table>
</form>
